
#ifndef SDLSTATICREPRESENTATION_H_
#define SDLSTATICREPRESENTATION_H_

#include <SDL.h>
#include <string>
#include <tr1/memory>
#include "staticRepresentation.h"
#include "SDLWindow.h"
#include "vector2.h"

namespace si_sdl
{
/**
 * The SDL implementation for the StaticRepresentation class.
 * Objects represented by this class include
 * - Bullets
 * - Rockets
 * - Background
 */
class SDLStaticRepresentation: public si::StaticRepresentation
{
public:

	SDLStaticRepresentation();


	/**
	 * Destroys this object and the "me" SDL_Surface.
	 * @return
	 */
	virtual ~SDLStaticRepresentation();

	/**
	 * Draws fMe. If virtualSize is not (0,0) then the object is rescaled and drawn at its virtual position.
	 * If virtualsize is (0,0) the object is NOT rescaled and placed at ABSOLUTE position in parameter.
	 * @param virtualPosition Absolute / Virtual position where the object will be drawn.
	 * @param virtualSize Virtual size of the object (if 0-0 the object is not resized).
	 */
	virtual void draw(si::Vector2 virtualPosition, si::Vector2 virtualSize);
	virtual void update(double time);

	/**
	 * Returns the size (non-resized) of the object.
	 * @return
	 */
	virtual si::Vector2 getSize() const;

	/**
	 * Draws the contents of "in" onto "fMe" at position "position"
	 * @param in The object that will be drawn at Position
	 * @param position top left position where in is drawn on this
	 */
	void merge(SDLStaticRepresentation& in, si::Vector2 position);

protected:
	/**
	 * Ourselves...
	 */
	std::tr1::shared_ptr<SDL_Surface> fMe;

	std::tr1::shared_ptr<SDL_Surface> fResized;

private:
	bool fHaveCorrectSize;




};

}

#endif /* SDLSTATICREPRESENTATION_H_ */
